<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link href="<%=request.getContextPath()%>/css/Style.css"
			type="text/css" rel="stylesheet">
		<link href="<%=request.getContextPath()%>/css/admin.css"
			type="text/css" rel="stylesheet">
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/js/img.js"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/js/jquery-1.3.2.js"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/js/select.js"></script>
		<script type="text/javascript">
			//删除
function delDataByNid(nid) {
	var flag = false;
	var s = "";
	for (i = 0; i < document.getElementsByName("sel").length; i++) {
		if (document.getElementsByName("sel")[i].checked) {
			s += document.getElementsByName("sel")[i].value + ",";
			flag = true;
		}
	}
	if (flag == false) {
		alert("\u81f3\u5c11\u9009\u62e9\u4e00\u6761\u8bb0\u5f55!");
		return false;
	}
	if (confirm("\u786e\u5b9a\u8981\u5220\u9664\u5417\uff1f")) {
		window.self.location = "delAboutObjs.htm?ids="+s+"&nid="+nid;
	}
}

//跳到添加页
function addData(url) {
     window.self.location = url;
     //window.showModalDialog(url,"newwin","dialogHeight: 500px; dialogWidth: 700px; dialogTop: 100px; dialogLeft: 255px; edge: Raised;");

}


//跳转到修改页面
function updatePage() {
	var count = 0;
	for (i = 0; i < document.getElementsByName("sel").length; i++) {
		if(document.getElementsByName("sel")[i].checked) {
			count++;
		}
	}
	if(count > 1 || count <1) {
		alert("请选择一条记录");
		return false;
	}
	var id;
	for (i = 0; i < document.getElementsByName("sel").length; i++) {
		if (document.getElementsByName("sel")[i].checked) {
			id = document.getElementsByName("sel")[i].value;
			break;
		}
	}
	
	var url = "<%=request.getContextPath()%>/admin/toUpdateAboutObj.htm?id="+id;
	window.self.location = url;
	//window.showModalDialog(url,"new","dialogHeight: 500px; dialogWidth: 700px; dialogTop: 100px; dialogLeft: 255px; edge: Raised;");
}

		</script>


		<title>关于我们</title>
	</head>
	<body>
			<table cellspacing="0" cellpadding="0" border="0" align="center"
				width="800">
				<tbody>
					<tr>
						<table width="100%" cellspacing="0" cellpadding="0"
							bordercolor="#003366" border="1" class="Table1" align="left">
							<tbody>
								<tr height="30px">
									
									<td colspan="9" class="thead">
										当前位置:
									<c:if test="${nid == 5}">公司文化</c:if>
									
									<c:if test="${nid == 18}">装修流程</c:if>
										<c:if test="${nid == 19}">服务范围</c:if>
										<c:if test="${nid == 21}">联系我们</c:if>
										<c:if test="${nid == 22}">联系方式</c:if>
										<br><br>
										
								</tr>
								<tr>
									<td colspan="9">
										<span class="top_c">
										<c:if test="${fn:length(objList) >= 1 and nid == 21 }">
												<input type="button" class="btn" disabled="disabled"
												onclick="addData('${pageContext.request.contextPath }/admin/admin.aboutus.add.jsp?nid=${nid }');"
												value="添加"> </span>
										</c:if>
										<c:if test="${nid != 21 || fn:length(objList) < 1}">
												<input type="button" class="btn"
												onclick="addData('${pageContext.request.contextPath }/admin/admin.aboutus.add.jsp?nid=${nid }');"
												value="添加"> </span>
										</c:if>
										<span class="top_c"><input type="button" class="btn"
												onclick="updatePage();" value="修改"> </span>
										<span class="top_c"><input type="button" class="btn"
												onclick="delDataByNid('${nid}');" value="删除"> </span>
									</td>
								</tr>
								<tr style="font-weight: bold; background: #EEEEEE;">
									<td height="25" align="center">
										<input id="cal" value="1" type="checkbox"
											onclick="selAll(value);" style="border: red 2px;">
									</td>
									<td height="25" align="center" >
										<font>地址</font>
									</td>
									<td height="25" align="center">
										电话
									</td>
									<td height="25" align="center" >
										传真
									</td>
									<td height="25" align="center" >
										手机
									</td>
									<td height="25" align="center" >
										联系人
									</td>
									<td height="25" align="center" >
										网址
									</td>
									<td height="25" align="center" >
										邮编
									</td>
									<td height="25" align="center" >
										邮箱
									</td>
								</tr>
								<c:forEach items="${objList}" var="pub">
									<tr>
										<td height="25" align="center">


											<input id="sel" name="sel" value="${pub.id }" type="checkbox">

										</td>
										<td height="25" align="center">
											${pub.address }
										</td>
										<td height="25" align="center">
											${pub.phone }
										</td>
										
										<td height="25" align="center">
											${pub.fax }
										</td>
										<td height="25" align="center">
											${pub.mobilePhone }
										</td>
										<td height="25" align="center">
											${pub.name }
										</td>
										<td height="25" align="center">
											${pub.url }
										</td>
										<td height="25" align="center">
											${pub.email }
										</td>
										<td height="25" align="center">
											${pub.postCode }
										</td>
										
									</tr>
								</c:forEach>
							</tbody>
						</table>

					</tr>
					<tr>
						<td style="height: 10px;" colspan="4"></td>
					</tr>

					<tr>
					</tr>
				</tbody>
			</table>
	</body>
</html>